load("@rules_rust//rust:defs.bzl", "rust_test")
load("//bazel:canisters.bzl", "rust_canister")

package(default_visibility = ["//rs:system-tests-pkg"])

DEPENDENCIES = [
    # Keep sorted.
    "@crate_index//:base64",
    "@crate_index//:candid",
    "@crate_index//:flate2",
    "@crate_index//:ic-cdk",
    "@crate_index//:ic-certified-map",
    "@crate_index//:serde",
    "@crate_index//:serde_cbor",
    "@crate_index//:sha2",
]

DEV_DEPENDENCIES = []

MACRO_DEPENDENCIES = [
    # Keep sorted.
]

MACRO_DEV_DEPENDENCIES = []

ALIASES = {}

rust_canister(
    name = "kv_store",
    srcs = [
        "src/_wasm_kv_store.rs",
        "src/cert.rs",
        "src/chunk.rs",
        "src/http.rs",
        "src/kv_store.rs",
        "src/lib.rs",
    ],
    aliases = ALIASES,
    crate_name = "kv_store",
    proc_macro_deps = MACRO_DEPENDENCIES,
    service_file = ":src/kv_store.did",
    version = "0.1.0",
    deps = DEPENDENCIES,
)

rust_test(
    name = "kv_store_test",
    srcs = [
        "src/cert.rs",
        "src/chunk.rs",
        "src/http.rs",
        "src/kv_store.rs",
        "src/lib.rs",
    ],
    aliases = ALIASES,
    proc_macro_deps = MACRO_DEPENDENCIES + MACRO_DEV_DEPENDENCIES,
    deps = DEPENDENCIES + DEV_DEPENDENCIES,
)
